<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr=["张三","张思","张武","王榴","王麒","李霸","李玖","刘仕"]
        let first_name=prompt("请输入姓氏")
        arr.forEach(function(v,i){
            if(first_name==v[0]){
                console.log(v);
            }else{
                console.log("没有");
            }    
        })
    </script>
</body>
</html>